package cn.ltgodm.template.user.mapper;

import cn.ltgodm.template.common.domain.entity.Menu;
import cn.ltgodm.template.common.domain.vo.MenuVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author wenpeng
* @description 针对表【lt_menu(菜单权限表)】的数据库操作Mapper
* @createDate 2024-03-18 20:43:33
* @Entity cn.ltgodm.template.common.domain.entity.Menu
*/
public interface MenuMapper extends BaseMapper<Menu> {

    List<String> selectMenuPermsByRoleId(Long roleId);

    List<String> selectMenuPermsByUserId(Long userId);

    IPage<MenuVO> selectMenuList(@Param("ew") LambdaQueryWrapper<Menu> lqw,IPage<Menu> page);

    IPage<MenuVO> selectMenuListByUserId(@Param("ew")LambdaQueryWrapper<Menu> lqw, @Param("userId") Long userId,IPage<Menu> page);

    MenuVO selectMenuById(Long menuId);

    List<Long> selectMenuListByRoleId(@Param("roleId") Long roleId,@Param("menuCheckStrictly") boolean menuCheckStrictly);

    Menu checkMenuNameUnique(Menu menu);

    int hasChildByMenuId(Long menuId);

    int checkMenuExistRole(Long menuId);
}




